﻿
namespace GMap.NET.MapProviders
{
    using System;

    /// <summary>
    /// ArcGIS_World_Street_Map provider, http://server.arcgisonline.com
    /// </summary>
    public class ArcGIS_ChinaOnlineStreetPurplishBlue_MapProvider : ArcGISMapMercatorProviderBase
    {
        public static readonly ArcGIS_ChinaOnlineStreetPurplishBlue_MapProvider Instance;

        ArcGIS_ChinaOnlineStreetPurplishBlue_MapProvider()
        {
        }

        static ArcGIS_ChinaOnlineStreetPurplishBlue_MapProvider()
        {
            Instance = new ArcGIS_ChinaOnlineStreetPurplishBlue_MapProvider();
        }

        #region GMapProvider Members

        readonly Guid id = new Guid("5e588fa7-a5d2-4ced-9786-e493c8bbaf33");
        public override Guid Id
        {
            get
            {
                return id;
            }
        }

        readonly string name = "ArcGIS_ChinaOnlineStreetPurplishBlue_Map";
        public override string Name
        {
            get
            {
                return name;
            }
        }

        public override PureImage GetTileImage(GPoint pos, int zoom)
        {
            string url = MakeTileImageUrl(pos, zoom, LanguageStr);

            return GetTileImageUsingHttp(url);
        }

        #endregion

        string MakeTileImageUrl(GPoint pos, int zoom, string language)
        {
            // http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/0/0/0jpg

            return string.Format(UrlFormat, zoom, pos.Y, pos.X);
        }
        static readonly string UrlFormat = "https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{0}/{1}/{2}";

    }
}